package model;

public abstract class Polygon {
	private int numSide;
	protected double arrSide[];
	
	public Polygon() {
		setNumSide(0);
		arrSide = null;
	}
	
	public Polygon(int num) {
		if (num >= 0) {
			setNumSide(num);
			arrSide = new double[getNumSide()];
		}
	}
	
	public void init() {
		for (int i = 0; i < arrSide.length; i++) {
			arrSide[i] = Math.random();
		}
	}
	
	public double getC() {
		double c = 0.0;
		
		for (int i = 0; i < arrSide.length; i++) {
			c =+ arrSide[i];
		}
		return c;
	}
	
	public abstract double getA();

	private int getNumSide() {
		return numSide;
	}

	private void setNumSide(int numSide) {
		this.numSide = numSide;
	}
	
	public void printSide() {
		for (int i = 0; i < arrSide.length; i++) {
			System.out.println("Side = " + arrSide[i]);
		}
	}
}
